***DoFile for Politics & Gender "A Trailblazer or a Barrier? "
*Created by Young-Im Lee
*Survey Company: Embrain (Seoul, South Korea); data received on 2020/05/26

**q106_4 = christianity count as protestant (cannot see q106q in Stata; identified from the original Excel
*replace q106=2 if sequence==736
*replace q106=2 if sequence==781
*replace q106=2 if sequence==1162
*replace q106=2 if sequence==1224
*replace q106=2 if sequence==1351
*replace q106=2 if sequence==1509
*replace q106=2 if sequence==1708
*replace q106=2 if sequence==1709
*replace q106=2 if sequence==1996

save "~/20200526_EmbrainData.dta"

*****
**Set the working directory yourself**

**Open the dataset
use "~20200526_EmbrainData.dta", clear


**label the variables
label variable q1 "gender (1 men 2 women)"
label variable q2_1 "age"
label variable q3 "agegroup"
label variable q4 "region (string)"
label variable q5 "citysize"
label variable q6 "irb agreement"
label variable q7 "2020 vote yesno"
label variable q8 "2020 vote distr"
label variable q9 "2020 vote pr"
label variable q10 "2020 female run yesno"
label variable q11 "2020 female vote yesno"
label variable q12 "2020 would vote distr"
label variable q13 "2020 would vote pr"
label variable q14 "favor gender"
label variable q15 "2020vote factor-economy"
label variable q16 "2020vote factor-covid"
label variable q17 "2020vote factor-rulingparty"
label variable q18 "2020vote factor-oppositionparty"
label variable q19 "2020vote factor-regionalism"
label variable q20 "2020vote factor-candidate"
label variable q21 "metoo"
label variable q22 "GEN-leadership"
label variable q23 "GEN-moral/corruption"
label variable q24 "GEN-work-task"
label variable q25 "GEN-work-relationship"
label variable q26 "GEN-childcare/household"
label variable q27 "GEN-joke"
label variable q28 "GEN-coldweather"
label variable q29 "GEN-staymom"
label variable q22 "GEN-h-leadership"
label variable q23 "GEN-b-moral/corruption"
label variable q24 "GEN-h-work-task"
label variable q22 "GEN-leadership"
label variable q23 "GEN-moral/corruption"
label variable q24 "GEN-work-task"
label variable q30 "GEN-competition"
label variable q31 "GEN-rescue"
label variable q32 "wealth distribution fair"
label variable q33 "SUCCESS-effort"
label variable q34 "SUCCESS-luck"
label variable q35 "SUCCESS-parents"
label variable q36 "SUCCESS-talent"
label variable q37 "SUCCESS-pedigree"
label variable q37 "SUCCESS-education"
label variable q38 "SUCCESS-gender"
label variable q39 "POL-interest"
label variable q40 "EFFICACY-vote"
label variable q41 "EFFICACY-complicated"
label variable q42 "EFFICACY-govtnointerest"
label variable q43 "EFFICACY-understand"
label variable q44 "EFFICACY-knowledge"
label variable q45 "EFFICACY-meaningfulwork"
label variable q46 "EFFICACY-pledge"
label variable q47 "PART-petition"
label variable q48 "PART-boycott"
label variable q49 "PART-protest"
label variable q50 "PART-polgathering"
label variable q51 "PART-contact"
label variable q52 "PART-socialmedia"
label variable q53 "PART-online activism"
label variable q54 "PART-online commenting"
label variable q55 "PART-hashtag"
label variable q56 "MEM-religion"
label variable q57 "MEM-lineagy/hometown/school"
label variable q58 "MEM-hobby/culture"
label variable q59 "MEM-friends"
label variable q60 "MEM-political party"
label variable q61 "MEM-ngo"
label variable q62 "MEM-interest groups"
label variable q63 "MEM-charity"
label variable q64 "2012vote"
label variable q65 "PARK-firstwoman"
label variable q66 "PARK-clean"
label variable q67 "PARK-performance"
label variable q68 "PARK-women policy"
label variable q69 "PARK-easy other women"
label variable q70 "PARK-daughter"
label variable q71 "PARK-difficult other women"
label variable q73 "IMP-dependent"
label variable q72 "IMP-woman"
label variable q74 "IMP-crony corruption"
label variable q75 "IMP-strong presidency"
label variable q76 "IMP-structure"
label variable q77 "IMP-journalism"
label variable q78 "IMP-conservative"
label variable q79 "IMP-liberal mobilization"
label variable q80 "IMP-indifference"
label variable q81 "IMP-dissatisfaction"
label variable q82 "IMP-college entrance"
label variable q83 "IMP-democracy"
label variable q84 "IMP-yesno"
label variable q85 "IMP-ACT-online post"
label variable q85 "IMP-SUP-online post"
label variable q86 "IMP-OPP-online post"
label variable q87 "IMP-SUP-discuss"
label variable q88 "IMP-OPP-discuss"
label variable q89 "IMP-SUP-money"
label variable q90 "IMP-OPP-money"
label variable q91 "IMP-SUP-protest"
label variable q92 "IMP-OPP-protest"
label variable q93 "IMP-SUP-recommend"
label variable q94 "IMP-OPP-recommend"
label variable q95 "IMP-post imp pol interest"
label variable q96 "ideology"
label variable q97 "2017vote"
label variable q98 "party yesno
label variable q99 "party like"
label variable q100 "party like if have to"
label variable q101 "occupation (string)"
label variable q102 "class self-placement"
label variable q103 "edu level"
label variable q104 "own house"
label variable q105 "household income"
label variable q106 "religion (string)"
label variable q107 "religious attendance"

******************************
*****combine some vars********
******************************

**party vote-vote yes no combine**
gen q8a=.
replace q8a=1 if q8==1
replace q8a=2 if q8==2
replace q8a=3 if q8==3
replace q8a=4 if q8==4
replace q8a=5 if q8==5
replace q8a=1 if q12==1
replace q8a=2 if q12==2
replace q8a=3 if q12==3
replace q8a=4 if q12==4
replace q8a=5 if q12==5
replace q8a=6 if q12==6
label variable q8a "q8+q12.2020 vote distr"

gen q9a=.
replace q9a=1 if q9==1
replace q9a=2 if q9==2
replace q9a=3 if q9==3
replace q9a=4 if q9==4
replace q9a=5 if q9==5
replace q9a=6 if q9==6
replace q9a=1 if q13==1
replace q9a=2 if q13==2
replace q9a=3 if q13==3
replace q9a=4 if q13==4
replace q9a=5 if q13==5
replace q9a=6 if q13==6
replace q9a=7 if q13==7
label variable q9a "q9+q13.2020 vote pr"

order sequence q1 q2_1 q3 q4 q5 q6 q7 q8 q8a q9 q9a

**party preference-preference yes no combine**
gen q99a=.

replace q99a=1 if q99==1
replace q99a=2 if q99==2
replace q99a=3 if q99==3
replace q99a=4 if q99==4
replace q99a=5 if q99==5
replace q99a=6 if q99==6

replace q99a=1 if q100==1
replace q99a=2 if q100==2
replace q99a=3 if q100==3
replace q99a=4 if q100==4
replace q99a=5 if q100==5
replace q99a=6 if q100==6
replace q99a=7 if q100==7

label variable q99a "q99+q100.party like"
order q99a, a(q99)


******************************
*****RECODE VARS**************
******************************
gen female=0
replace female=1 if q1==2
order female, a(q1)
label variable female "1 female 0 male (q1)"

gen city=2
replace city=1 if q5==2
replace city=0 if q5==3
order city, a(q5)
label variable city "2 big city 1 midsize 0 rural (q5)"

**create TK (regional cleavage) var
gen tk=0
replace tk=1 if q4==3
replace tk=1 if q4==14
label variable tk "TK(taeku kyongbuk)"

*Park party id
gen partysnr=0
replace partysnr=1 if q99a==2

*Park pres. vote 2012
gen parkvote=0
replace parkvote=1 if q64==1


*Political Interest
gen polinterest=q39

*Park less corrupt
gen parkcorrupt = q66
*currently 1: Strongly Agree, 5: Strongly Disagree
*recode to make 1: SD, 5: SA
replace parkcorrupt=1 if q66==5
replace parkcorrupt=2 if q66==4
replace parkcorrupt=4 if q66==2
replace parkcorrupt=5 if q66==1
tab parkcorrupt q66



*****WEIGHTING (done on 12/16/2020)***
*check "Online Supplementary Material 2 for the population data (census)
*weight = census/sample

*edu
gen edu=q103
generate eduwt=3.09/35.75 if edu==1
replace eduwt=14.95/22.29 if edu==2
replace eduwt=72.51/41.68 if edu==3
replace eduwt=9.44/.27 if edu==4
tab edu, summ(eduwt)

gen class=q102 
generate classwt=6.18/.40 if class==1
replace classwt=44.03/7.90 if class==2
replace classwt=41.69/41 if class==3
replace classwt=7.77/35.5 if class==4
replace classwt=.33/15.20 if class==5
tab class, summ(classwt)


*q96 ideology question runs between 0 and 10 (thus, 1 to 11 in the codebook)

tab q96

gen liberal=0
replace liberal=1 if q96==8
replace liberal=1 if q96==9
replace liberal=1 if q96==10
replace liberal=1 if q96==11
gen conservative=0
replace conservative=1 if q96==1
replace conservative=1 if q96==2
replace conservative=1 if q96==3
replace conservative=1 if q96==4

gen moderate=0
replace moderate=1 if q96==5
replace moderate=1 if q96==6
replace moderate=1 if q96==7

*political id weight data from Gallup Korea "Gallup Daily Opinion (403th) 2020 May 4th week; study data 5/26-28)
generate polsid3=0
replace polsid3=22.6/10.7 if conservative==1
replace polsid3=30.04/59.06 if moderate==1
replace polsid3=32.53/30.24 if liberal==1

**Final weight**
generate finalwt=  eduwt*polsid3* classwt
replace finalwt=1 if finalwt>=.
summ finalwt
replace finalwt = finalwt*(r(N)/r(sum))
summ finalwt

svyset sequence [pweight=finalwt]

**desc statistics

****
gen gwangju=0
replace gwangju=1 if q4==5
gen SIG=0
replace SIG=1 if q4==1
replace SIG=1 if q4==8
replace SIG=1 if q4==4

gen cyn=q46

gen partydem=0
replace partydem=1 if q99a==1

gen libwoman = 0
replace libwoman=1 if liberal==1 & female==1
gen libman =0
replace libman=1 if liberal==1&female==0
gen conswoman=0
replace conswoman=1 if conservative==1&female==1

gen genderid = female*polidlib10

gen intlibgender=liberal*female
gen intconsergender=conservative*female


****************************************************
*Contribution
****************************************************
*Table 2. first female president symbolism

gen firstwoman=q65

svy:reg firstwoman female liberal conservative
svy:reg firstwoman female liberal conservative parkvote age tk gwangju SIG cyn class edu


*Table 2. Park women policy promotion
gen womenpolicy=q68

svy:reg womenpolicy female liberal conservative
svy:reg womenpolicy female liberal conservative parkvote age tk gwangju SIG cyn class edu

*Table 3. Park election = other women easily electd 

gen glassceiling = q69

svy:reg glassceiling female liberal conservative
svy:reg glassceiling female liberal conservative parkvote age tk gwangju SIG cyn class edu


*Table 3. Park impeachment = barrier to other women
gen barrier=q71
svy:reg barrier female liberal conservative
svy:reg barrier female liberal conservative parkvote age tk gwangju SIG cyn class edu

